/*
 * DiffTextArea.java
 * @author Andrey Tesler
 * Created for DiffView project
 * Created on 4 October 2009, 13:54
 */

package diffview.gui;

import java.util.*;
import java.io.*;
import static java.lang.Math.*;
import static java.lang.System.*;
import java.awt.*;
import java.util.List; // THIS, not java.awt.List, is denoted "List" !
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import diffview.*;

public class DiffTextArea extends JTextArea {
    
    public DiffTextArea() {
        super(30, 30);
        setMinimumSize(new Dimension(350, 450));
        ///this.setReadOnly(true) or something like this - there is it???
    }
    
    public void setText(List<String> lines) {
        StringBuilder builder = new StringBuilder();
        for (Iterator<String> it = lines.iterator(); it.hasNext(); ) {
            builder.append(it.next());
            if (it.hasNext()) {
                builder.append("\n");
            }
        }
        setText(builder.toString());
    }
    
}
